package com.cnhaimei.vod.logic;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

import com.cnhaimei.base.TransparentActivity;
import com.cnhaimei.vod.R;
import com.cnhaimei.vod.bean.Room;
import com.cnhaimei.vod.bean.Singer;
import com.cnhaimei.vod.bean.Song;
import com.cnhaimei.vod.logic.EventsManager.EventsListener;
import com.cnhaimei.vod.net.NetManager;
import com.cnhaimei.vod.net.XVod;
import com.cnhaimei.vod.util.Const;
import com.cnhaimei.vod.util.Util;

/**
 * 点歌更多界面
 * 
 * @author funwell <br>
 * @date 2013-6-04
 * 
 */
public class SelSongMoreActivity extends TransparentActivity implements OnClickListener{
	
	private Song mSong;
	private Singer mSinger;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.v8_sel_song_more);
		
		setClickable(R.id.sel_song, R.id.sel_singer, R.id.insert_song, R.id.add_favorites, R.id.cancel);
		
		mSong = (Song)getIntent().getSerializableExtra(Const.Key.SONG_INFO);
		if (mSong != null) {
			TextView name = (TextView)findViewById(R.id.name);
			if (name != null) {
				name.setText("已选择：" + mSong.getName());
			}
		}
		//mSinger = (Singer)getIntent().getSerializableExtra(Const.Key.SINGER_INFO);		
	}
	
	@Override
	public void onClick(View v) {
		super.onClick(v);
		Intent intent = new Intent();
		intent.putExtra(Const.Key.SONG_INFO, mSong);
		switch (v.getId()) {
		case R.id.sel_song: //点歌		
			setResult(Const.ResultCode.SEL_SONG, intent);
			finish();
			break;
		case R.id.insert_song://插播
			setResult(Const.ResultCode.INSERT_SONG, intent);
			finish();
			break;
		case R.id.sel_singer://歌星反查
			setResult(Const.ResultCode.SEL_SINGER, intent);
			finish();
			break;
		case R.id.add_favorites://收藏
			setResult(Const.ResultCode.ADD_FAVORITE, intent);
			finish();
			break;
		case R.id.cancel://取消
			setResult(RESULT_CANCELED);
			finish();
			break;
		default:
			break;
		}
	}
	
}
